package net.atomarrow.sy.form;

import net.atomarrow.bean.Pager;

public class Form {
	private Integer draw;//第一次 用来区分
	private String searchValue;//查询内容
    private String orderDir; // 排序方式 desc asc
    private Integer orderColumnNum; // 排序字段序号
    private String orderColumnName; // 排序字段名称
    private Integer length; //查询长度
    private Integer start;// 开始位置
    private boolean noPage;//是否使用分页
    private Pager pager;//分页
    public  int getDataTotal(){
    	if(pager==null){
    		return 0;
    	}
    	return pager.getDataTotal();
    } 
    public Pager getPager(){
        if(noPage){
            return null;
        }else{
            if(pager==null){
                pager=new Pager(start, length);
            }
            return pager;
        }
    }
    /**
     * 不使用分页
     */
    public void noPaging(){
        noPage=true;
    }
    public void setPager(Pager pager) {
        this.pager = pager;
    }
	public String getSearchValue() {
		return searchValue;
	}
	public void setSearchValue(String searchValue) {
		this.searchValue = searchValue;
	}
	public String getOrderDir() {
		return orderDir;
	}
	public void setOrderDir(String orderDir) {
		this.orderDir = orderDir;
	}
	public Integer getOrderColumnNum() {
		return orderColumnNum;
	}
	public void setOrderColumnNum(Integer orderColumnNum) {
		this.orderColumnNum = orderColumnNum;
	}
	public String getOrderColumnName() {
		return orderColumnName;
	}
	public void setOrderColumnName(String orderColumnName) {
		this.orderColumnName = orderColumnName;
	}
	public Integer getLength() {
		return length;
	}
	public void setLength(Integer length) {
		this.length = length;
		if(length==null||length==-1){
			setNoPage(true);
		}
	}
	public Integer getStart() {
		return start;
	}
	public void setStart(Integer start) {
		this.start = start;
	}
	public boolean isNoPage() {
		return noPage;
	}
	public void setNoPage(boolean noPage) {
		this.noPage = noPage;
	}
	public Integer getDraw() {
		return draw;
	}
	public void setDraw(Integer draw) {
		this.draw = draw;
	}

}
